package com.dreammakerteam.frameworkdemo.base.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.dreammakerteam.frameworkdemo.base.domain.DAreaDo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
  * 地区 Mapper 接口
 * </p>
 *
 * @author Yanghu
 * @since 2017-10-16
 */
@Mapper
@Repository
public interface DAreaMapper extends BaseMapper<DAreaDo> {

    @Select("SELECT * FROM d_area WHERE da_parent_id IS NULL")
    List<DAreaDo> getProvince();

    @Select("SELECT * FROM d_area WHERE da_parent_id = #{parentId}")
    List<DAreaDo> getByParent(Long parentId);

}